package com.cskaoyan.servlet;

import com.cskaoyan.bean.common.BaseRespVo;
import com.cskaoyan.bean.vo.GoodsVo;
import com.cskaoyan.service.GroupGoodsDetailService;
import com.cskaoyan.service.GroupGoodsDetailServiceImpl;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/admin/goods/detail")
public class GroupGoodsDetailServlet extends WdBaseServlet{
    public BaseRespVo detail(HttpServletRequest request, HttpServletResponse response) {
//        Integer page = Integer.parseInt(request.getParameter("page"));
//        Integer limit = Integer.parseInt(request.getParameter("limit"));
//        String order = request.getParameter("order");
//        String sort = request.getParameter("sort");
//
//
//        CommonData data = groupGoodsManagementService.groupGoodsQuery(page,limit,sort,order);

        String goodsId = request.getParameter("id");
        GroupGoodsDetailService groupGoodsDetailService = new GroupGoodsDetailServiceImpl();
        GoodsVo goodsVo = groupGoodsDetailService.selectGoods03(goodsId);
        return BaseRespVo.ok(goodsVo);//会转换为json字符，然后通过 response的getWriter去响应
    }
}
